Skip to content

Install scripts: update an installed Claude Code plugin - #1824

Merged
backnotprop merged 3 commits into
mainfrom
feat/install-updates-claude-plugin
Oct 10, 2026
Merged

backnotprop merged 3 commits into
mainfrom
feat/install-updates-claude-plugin

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Why

The Claude Code plugin (plannotator@plannotator) comes from a GitHub marketplace, which Claude Code does not auto-update by default. The installers only printed claude plugin marketplace update plannotator / claude plugin update plannotator@plannotator, so updating the binary (by hand or through background auto-update, which reruns install.sh) left users on an old plugin, without the mod's Inbox connection and every mod fix since.

What

All three installers (install.sh, install.ps1, install.cmd, kept in step) now, right after the legacy marketplace-clone hooks.json repair:

  • detect an installed plugin from Claude Code's registry, ${CLAUDE_CONFIG_DIR:-~/.claude}/plugins/installed_plugins.json (user-scope record; a v1 record without scope counts; project/local-only installs are left alone). No claude plugin list parsing.
  • if the claude CLI is on PATH and the user did not opt out, run claude plugin marketplace update plannotator then claude plugin update plannotator@plannotator, each with stdin closed, CLAUDECODE cleared, and a 120 s time limit (pure-shell watchdog on POSIX, WaitForExit + kill on Windows).
  • report from the registry's before/after version/gitCommitSha/installPath:
    • Claude Code plugin: updated to 0.28.11 (restart Claude Code to load it).
    • Claude Code plugin: already up to date (0.28.11).
    • Claude Code plugin: could not update it (<reason>). Run these, then restart Claude Code: + the two commands. The install still exits 0.
    • Claude Code plugin: not updated (--skip-claude-plugin).
  • closing banner: no install/update block when updated or current; only the two manual commands when installed but skipped, failed, or no CLI; unchanged install instructions when not installed.

It never installs the plugin, never touches other marketplaces/plugins, and never starts a Claude session.

Opt-out: --skip-claude-plugin (PowerShell -SkipClaudePlugin), PLANNOTATOR_SKIP_CLAUDE_PLUGIN_UPDATE=1, { "skipInstall": { "claudePlugin": true } }; flag > env > config. --minimal skips it; --non-interactive does not. The flag is recorded in install-flags.json as skip-claude-plugin and added to the auto-update allowlist (packages/server/auto-update.ts). Older binaries drop the unknown id with an update.log line (parseInstallFlags).

Docs: CLAUDE.md env row + auto-update flag list, marketing installation + environment-variables pages, README update line.

Tests

scripts/install.test.ts with a fake claude that logs its argv (temp HOME, temp CLAUDE_CONFIG_DIR, no real CLI):

  • install.sh functional: installed (both commands in order, new version reported), already current, ordering after the hooks.json repair (the fake sees the repaired file at marketplace-update time), v1 registry, not installed (no registry / other plugin / project scope only / empty list), each opt-out (flag, env, config, flag over env 0, env 0 over config), --minimal, failing marketplace update, failing plugin update, hanging claude (1 s limit), no claude on PATH, install-flags.json.
  • install.ps1 region and install.cmd's exact PowerShell command driven under pwsh (CI has pwsh): updated, current, project-only, opted out, failure, timeout, no CLI.
  • source scans for flags/env/config in all three, update-after-repair ordering, and no cmd-hostile characters in the cmd PowerShell.
  • auto-update.test.ts: skip-claude-plugin kept and spelled per installer.

bun test scripts/install.test.ts packages/server/auto-update.test.ts (with pwsh 7.5 on PATH): 255 pass, 0 fail. bun run typecheck clean. shellcheck: no new warnings.

Unsure

  • claude plugin update defaults to the user scope (that is why only user-scope records trigger it); not verified against a live Claude Code.
  • CLAUDECODE is cleared defensively in case plugin subcommands refuse to run nested; not verified live.
  • The marketplace update runs first because plugin update copies from the local marketplace clone (the docs in this repo already say refreshing the marketplace alone is not enough, and the reverse is presumed).

The Claude Code plugin comes from a GitHub marketplace, which Claude Code
does not auto-update, so updating the binary (by hand or by auto-update)
left an old plugin behind. When the claude CLI is on PATH and
plannotator@plannotator has a user-scope record in
${CLAUDE_CONFIG_DIR:-~/.claude}/plugins/installed_plugins.json, all three
installers now run 'claude plugin marketplace update plannotator' and
'claude plugin update plannotator@plannotator' right after the legacy
hooks.json repair: time-bounded, stdin closed, CLAUDECODE cleared, never
failing the install (a failure prints the manual commands). The closing
banner follows what happened.

Opt out with --skip-claude-plugin (-SkipClaudePlugin),
PLANNOTATOR_SKIP_CLAUDE_PLUGIN_UPDATE=1 or skipInstall.claudePlugin;
--minimal skips it. The flag is recorded in install-flags.json as
skip-claude-plugin and replayed by auto-update.
…-adds a missing marketplace

Review fixes for the Claude Code plugin update:
- 'claude plugin update plannotator@plannotator --scope user' in all three
  installers and every printed manual command: current Claude Code
  auto-detects the scope and, inside a project with a project-scope
  install, updated that record and left the user install old.
- install.sh keeps claude's output and the timeout marker in one private
  mktemp -d directory, removed afterwards; no directory, no update.
- A missing plannotator marketplace prints
  'claude plugin marketplace add backnotprop/plannotator' instead.
- A --version pin skips the update (one line). Auto-update's --version is
  the newest release it just resolved, exported as
  PLANNOTATOR_UPDATE_VERSION, so it is not a pin; no extra network call.
…en pipe'

Start-Process -RedirectStandardInput copies its file into the child's
stdin after the start and throws 'Broken pipe' when claude has already
exited (seen on CI under Linux pwsh for every plugin test; a fast
'already up to date' can do the same for real users). install.ps1 and
install.cmd's PowerShell now start claude with
System.Diagnostics.Process, close its stdin pipe at once in its own
try/catch, read stdout/stderr asynchronously, and report 'could not run
claude' only when the start itself fails. New test: a claude that exits
at once without reading stdin, five times per runner.
@backnotprop
backnotprop merged commit d7618df into main Oct 10, 2026
31 checks passed
@backnotprop
backnotprop deleted the feat/install-updates-claude-plugin branch October 10, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant